package com.hhx.service.impl;

import com.hhx.dao.GoodsDao;
import com.hhx.dao.impl.GoodsDaoImpl;
import com.hhx.entity.Goods;
import com.hhx.service.GoodsService;

import java.util.List;


/**
 * 商品业务层实现类
 */
public class GoodsServiceImpl implements GoodsService {

    private GoodsDao dao = new GoodsDaoImpl();

    @Override
    public List<Goods> getAll(String name, Integer current, Integer limit) {
        return dao.getAll(name, current, limit);
    }

    @Override
    public int count(String name) {
        return dao.count(name);
    }

    @Override
    public int add(Goods g) {
        return dao.add(g);
    }

    @Override
    public int delete(String id) {
        return dao.delete(id);
    }

    @Override
    public Goods getById(String id) {
        return dao.getById(id);
    }

    @Override
    public int update(Goods g) {
        return dao.update(g);
    }
}
